home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic 4 Database How-To
/
Visual Basic 4 Database - How-to (The Waite Group)(1995).iso
/
setupwiz.fr_
/
setupwiz.fr
Wrap
Text File
|
1995-07-06
|
3KB
|
126 lines
VERSION 4.00
Begin VB.Form Form1
BackColor = &H00C0C0C0&
Caption = "Setup Wizard Prototype"
ClientHeight = 4230
ClientLeft = 360
ClientTop = 3195
ClientWidth = 9105
BeginProperty Font
name = "MS Sans Serif"
charset = 0
weight = 700
size = 8.25
underline = 0 'False
italic = 0 'False
strikethrough = 0 'False
EndProperty
Height = 4635
Left = 300
LinkTopic = "Form1"
ScaleHeight = 4230
ScaleWidth = 9105
Top = 2850
Width = 9225
Begin VB.CommandButton cmdClose
Caption = "&Close"
Height = 495
Left = 3780
TabIndex = 1
Top = 3420
Width = 1695
End
Begin VB.Label Label1
AutoSize = -1 'True
BackColor = &H00C0C0C0&
Caption = "Publishers:"
Height = 195
Left = 240
TabIndex = 2
Top = 300
Width = 945
End
Begin MSGrid.Grid Grid1
Height = 2535
Left = 240
TabIndex = 0
Top = 600
Width = 8595
_Version = 65536
_ExtentX = 15161
_ExtentY = 4471
_StockProps = 77
BackColor = -2147483643
FixedCols = 0
End
End
Attribute VB_Name = "Form1"
Attribute VB_Creatable = False
Attribute VB_Exposed = False
Option Explicit
Private Sub cmdClose_Click()
End
End Sub
Private Sub Form_Load()
Dim db As DATABASE
Dim dbName As String
Dim rs As Recordset
Dim sql As String
On Error GoTo LoadError
InitializeGrid
Me.Show
Me.Refresh
Screen.MousePointer = 11
' Get the database name and open the database.
dbName = BiblioPath() ' BiblioPath is a function in READINI.BAS
Set db = DBEngine.Workspaces(0).OpenDatabase(dbName)
sql = "SELECT [Name], [Address], [City], [State], [Zip]"
sql = sql & " FROM [Publishers] ORDER BY [Name]"
Set rs = db.OpenRecordset(sql, dbOpenSnapshot)
If rs.RecordCount > 0 Then
rs.MoveFirst
Do
Grid1.AddItem rs![Name] & Chr$(9) & rs! _
[Address] & Chr$(9) & rs![City] & Chr$(9) & rs![State] & Chr$(9) & rs![Zip]
rs.MoveNext
Loop While Not rs.EOF
End If
Grid1.RemoveItem 1
Screen.MousePointer = 0
Exit Sub
LoadError:
Screen.MousePointer = 0
MsgBox Err.Description
Exit Sub
End Sub
Private Sub InitializeGrid()
Grid1.Cols = 5
Grid1.Row = 0
Grid1.Col = 0
Grid1.ColWidth(0) = 2600
Grid1.TEXT = "Publisher"
Grid1.Col = 1
Grid1.ColWidth(1) = 3000
Grid1.TEXT = "Address"
Grid1.Col = 2
Grid1.ColWidth(2) = 1200
Grid1.TEXT = "City"
Grid1.Col = 3
Grid1.ColWidth(3) = 400
Grid1.TEXT = "St"
Grid1.Col = 4
Grid1.ColWidth(4) = 1100
Grid1.TEXT = "Zip Code"
End Sub